//
//  UIView+Designable.m
//  Pods-ToolUtil_Example
//
//  Created by 露露 on 2017/10/10.
//

#import "UIView+Designable.h"
#import <YYKit/YYKit.h>
// 屏幕适配，获取缩放后的值
#define ks(v) (kScreenWidth/375.0 * v)

@implementation UIView (Designable)
- (void)setCornerRadius:(CGFloat)cornerRadius {
    self.layer.cornerRadius  = ks(cornerRadius);
    self.layer.masksToBounds = YES;
}

- (CGFloat)cornerRadius {
    return self.layer.cornerRadius;
}

- (void)setBorderColor:(UIColor *)borderColor {
    self.layer.borderColor = borderColor.CGColor;
}

- (UIColor *)borderColor {
    return [UIColor colorWithCGColor:self.layer.borderColor];
}

- (void)setBorderWidth:(CGFloat)borderWidth {
    self.layer.borderWidth = borderWidth;
}

- (CGFloat)borderWidth {
    return self.layer.borderWidth;
}

//- (void)setBgColorHex:(NSString *)bgColorHex {
//    self.backgroundColor = yy_color(bgColorHex);
//}
//
//- (NSString *)bgColorHex {
//    return [self.backgroundColor hexString];
//}
//
//- (void)setRound:(BOOL)round {
//    self.layer.cornerRadius = (NSInteger)ks(self.height)/2;
//}
//
//- (BOOL)round {
//    return (NSInteger)self.layer.cornerRadius == (NSInteger)ks(self.width)/2 && (NSInteger)self.layer.cornerRadius == (NSInteger)ks(self.height)/2;
//}
@end
